load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "colrpc",
    srcs = [
        "inbox.go",
        "outbox.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/col/coldata",
        "//pkg/col/colserde",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/flowinfra",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/types",
        "//pkg/util/admission",
        "//pkg/util/cancelchecker",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/mon",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@io_opentelemetry_go_otel//attribute",
    ],
)

go_test(
    name = "colrpc_test",
    size = "small",
    srcs = [
        "colrpc_test.go",
        "inbox_test.go",
        "main_test.go",
        "outbox_test.go",
    ],
    embed = [":colrpc"],
    deps = [
        "//pkg/base",
        "//pkg/col/coldata",
        "//pkg/col/coldatatestutils",
        "//pkg/col/colserde",
        "//pkg/settings/cluster",
        "//pkg/sql/colexec/colexecargs",
        "//pkg/sql/colexec/colexectestutils",
        "//pkg/sql/colexec/colexecutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/util/cancelchecker",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_grpc//:go_default_library",
    ],
)
